package com.open.capacity.notice.provider.wechat;

import java.text.MessageFormat;

import org.springframework.web.bind.annotation.RequestMethod;

import com.open.capacity.notice.provider.core.http.ApiAdress;

/**
 * E云管家登录
 */
public enum WechatApiAddress implements ApiAdress {

	// ---------------- E云管家登录管理------------------
	//59.36.146.193:9899
	/**
	 * 登录E平台 URL: http://{0}/member/login
	 */
	LOIGN_IN("登录", RequestMethod.POST, "http://{0}/member/login"),
	/**
	 * 获取二维码方式 URL: http://{0}/iPadLogin
	 */
	ACQUIARE_QR_CODE("获取二维码", RequestMethod.POST, "http://{0}/iPadLogin"),
	/**
	 * 执行微信登录 URL: http://{0}/getIPadLoginInfo
	 */
	EXEC_WX_LOGIN("执行微信登录", RequestMethod.POST, "http://{0}/getIPadLoginInfo"),
	/**
	 * 初始化通讯录列表 URL: http://{0}/initAddressList
	 */
	INIT_ADDRESS_LIST("初始化通讯录列表", RequestMethod.POST, "http://{0}/initAddressList"),
	/**
	 * 获取通讯录列表 URL: http://{0}/getAddressList
	 */
	ACQUIARE_ADDRESS_LIST("获取通讯录列表", RequestMethod.POST, "http://{0}/getAddressList"),
	/**
	 * 获取联系人信息 URL: http://{0}/getContact
	 */
	ACQUIARE_CONTACT_INFO("获取联系人信息", RequestMethod.POST, "http://{0}/getContact"),
	/**
	 * 二次登录 URL: http://{0}/secondLogin
	 */
	SECOND_LOGIN("二次登录", RequestMethod.POST, "http://{0}/secondLogin"),

	// ---------------- E云管家消息发送------------------
	SEND_TEXT("发送文本消息", RequestMethod.POST, "http://{0}/sendText"),

	SEND_FILE("发送文件", RequestMethod.POST, "http://{0}/sendFile"),;

	private String opt;

	private RequestMethod method;
	private String url;

	WechatApiAddress(String opt, RequestMethod method, String url) {
		this.opt = opt;
		this.method = method;
		this.url = url;
	}

	public String getOpt() {
		return opt;
	}

	public RequestMethod getMethod() {
		return method;
	}

	public String getUrl() {
		return url;
	}

	public String getUrl(Object... args) {
		return MessageFormat.format(url, args);
	}

}
